#ifndef MYSHOTS_H
#define MYSHOTS_H

#include "MyDefinitions.h"
#include "MyShot.h"

class MyShot;
class MyGame;

/*! 
 *  \struct shotType
 *  \brief info about different shot types are stored here
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
struct shotType {
	/*! w & h of the projectil */
	int shot_w, shot_h;
	/*! vertical position in the shotSheet */
	int pos_in_sheet;
	/*! inital speed of the projectile */
	double speed_initial;
	/*! number of different rotation phases */
	int phase_count;
	/*! type of flight - true = ballistic, false = straight */
	bool ballistic;
	/*! mana_consume > 0 ==> spell */
	int mana_consume;
	} ;

/*! 
 *  \class MyShots
 *  \brief class wrapper for all projectils in the game
 *  \author Peter Kosa
 *  \version 1.52
 *  \date    2006-2008
 */
class MyShots{
	public:		
		MyShots(MyGame* parent);
		~MyShots();
		
		/*! sheet with shot sprites */
		SDL_Surface *shotSheet;				
		/*! sheet with spell sprites */
		SDL_Surface *spellSheet;
    //pointer to parent game
		MyGame* parent;
		/*! array of possible shot types */
		shotType shotTypeArray[ST_SHOT_COUNT + ST_SPELL_COUNT];		
    /*! list of current shots in game */
		std::list<MyShot> shotSwarm;		
    /*! init list */ 
		void init_projectils();					
		/*! load sprite sheets imgs */
		void load_imgs();						
		/*! release all resources used by this class */
		void clean_projectils();				
		/*! add new shot */
		void add_projectile(double _x, double _y, double _angle, shotType* _type, int owner, int dmg);	
		/*! draw the projectils one by one after position change */
		void draw_projectils(int _t);								
		/*! flag for correct deinit */
		bool wasInit;	
	private:
		Uint32 lastUpdate;
};
#endif

